{template 'common/header'}
<ul class="nav nav-tabs">
	<li><a href="{php echo create_url('site/module/GetFans',array('name'=>'ifans','state'=>''));}">同步微信用户</a></li>
    <li class="active"><a href="{php echo create_url('site/module/GetFans',array('name'=>'ifans','state'=>''));}">微信用户列表</a></li>
    
</ul>
<div class="main">
	<div class="stat">
		<div class="stat-div">
			<div class="navbar navbar-static-top">

			</div>
			<div class="sub-item" id="table-list">
                <form action="" method="post" onsubmit="">
                    <div>
                        昵称：<input name="nickname" value="{$nickname}" type="text"/> &nbsp;&nbsp;&nbsp;&nbsp;
                        真实姓名：<input name="realname" value="{$realname}" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;
                        用户角色：<select name="type">
                            <option value="">请选择</option>
                            <option value="0" {if $type==0 } selected {/if}>普通关注者</option>
                            <option value="1" {if $type==1 } selected {/if}>厨师</option>
                            <option value="2" {if $type==2 } selected {/if}>名店</option>
                        </select>
                        &nbsp;&nbsp;&nbsp;&nbsp;<input name="sub" type="submit" value="提交" />
                    </div>
                </form>
				<h4 class="sub-title">详细数据(共{$total}名关注者 )</h4>
				<form action="" method="post" onsubmit="">
				<div class="sub-content">
					<table class="table table-hover">
						<thead class="navbar-inner">
							<tr>
								<th class="row-first" width="50"><input type="checkbox" onclick="selectall(this, 'select');" /></th>
								<th  width="80">昵称</th>
								<th  width="100">用户角色</th>
    							<th  width="100">真实姓名</th>
                                <th  width="100">联系电话</th>
                                <th  width="150">店铺名称</th>
    							<th  width="120">关注时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody >
							{loop $list $row}
                            
                            <?php
                            
                            //$uinfo=pdo_getuserinfo($_W['weid'],"",$row["id"]);
                            
                            ?>
							<tr>
								<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>
								<td style="text-align:center;">
                                {if strlen($row['avatar'])>10 }
                                    <img src="{$row['avatar']}" width="50" />
                                {else}
                                    <img src="/manage/images/i07.png" width="50" />
                                {/if}
                                
                                <br />
                                <a href="{php echo create_url('site/module/profile', array('name' => 'fans','from_user' => $row['from_user']))}" title="{$row['nickname']}">{$row['nickname']}</a></td>

                                <td style="text-align:center;">
                                    {if $uinfo['grade']==1 }
                                        厨师
                                    {else if $uinfo['grade']==2 }
                                        名店
                                    
                                    {else}
                                       普通关注者
                                    {/if}
                                </td>
								<td style="text-align:center;">
									{$row['realname']}
								</td>
								<td style="text-align:center;">
									{$row['mobile']}
								</td>                                                                
								<td style="text-align:center;">
									{$row['company']}
								</td>   
								<td style="font-size:12px;text-align:center;color:#666;">
									{php echo date('Y-m-d H:i:s', $row['createtime']);}
								</td>
								<td style="text-align:center;">
									<a href="{php echo create_url('site/module/profile', array('name' => 'fans','from_user' => $row['from_user']))}">编辑</a>
									<a href="{php echo create_url('site/module/send', array('name' => 'ifans', 'openid' => $row['from_user']))}">联系TA</a>
                                                                        <a href="{php echo create_url('site/module/given', array('name' => 'ifans', 'openid' => $row['from_user']))}">下发优惠劵</a>
								</td>
							</tr>
							{/loop}
							<tr class="search-submit">
								<td colspan="7">
                                    <input type="submit" name="updateselects" value="更新选中" style="color:green;" class="btn pull-right" onclick="{if(confirm('确定更新选中项吗?')){return true;}return false;}"/>&nbsp;&nbsp;
									<input type="submit" name="deleteselects" value="删除选中" style="color:red;" class="btn pull-right" onclick="{if(confirm('确定删除选中项吗?')){return true;}return false;}"/>
									<input type="hidden" name="token" value="{$_W['token']}" />
								</td>
							</tr>
						</tbody>
					</table>
					<table class="table">
						<tr>
							<td class="row-first"></td>
							<td>
								<input type="hidden" name="token" value="{$_W['token']}" />
							</td>
						</tr>
					</table>
				</div>
				</form>
				{$pager}
			</div>
		</div>
	</div>
</div>
{template 'common/footer'}